package champPackage;

import java.util.HashMap;

public class TableLine{
	private HashMap<String, Integer>map;
	private String teamName;
	private int champ_id;
	private int team_id;
	
	/** 
	 * Team object is passed to perform calculations on the Team
	 * @param t
	 */
	public TableLine(int champ_id, int team_id){
		//teamName=name;
		map = new HashMap<String, Integer>();
		this.champ_id = champ_id;
		this.team_id = team_id;
	}
	
	@Override
	public String toString(){
		return champ_id+" "+team_id+" "+map.get("getPlayed")+" "+map.get("getDraws")+" "+map.get("getLost")+" "+map.get("getScored")+
				" "+map.get("getReceived")+" "+map.get("getPoint");
	}
	
	/**
	 * sets number of played matches
	 * @param numPlayed
	 */
	public void setPlayed(int numPlayed){
		map.put("getPlayed", numPlayed);
		
	}
	
	
	/**
	 * sets number of won matches
	 * @param won
	 */
	public void setWon(int won){
		map.put("getWon", won);
	}
	/**
	 * sets number of draws
	 * @param draws
	 */
	public void setDraws(int draws){
		map.put("getDraws", draws);
	}
	
	/**
	 * sets number of lost matches
	 * @param lost
	 */
	public void setLost(int lost){
		map.put("getLost", lost);
	}
	
	/**
	 * number of the scored goals by this team
	 * @param scored
	 */
	public void setScored(int scored){
		map.put("getScored", scored);
	}
	
	/**
	 * number of received goals by this teams
	 * @param rec
	 */
	public void setReceived(int rec){
		map.put("getReceived", rec);
	}
	
	/**
	 * point of the team at current point
	 * @param point
	 */
	public void setPoint(int point){
		map.put("getPoint", point);
	}
	
	/**
	 * place of the team in the championship
	 * @param place
	 */
	public void setPlace(int place){
		map.put("getPlace", place);
	}
	
	/**
	 * gets Team name for the table
	 */
	public String getTeamName(){
		return teamName;
	}
	/**
	 * gets number of played matches
	 * @param numPlayed
	 */
	public int getPlayed(){
		if(!map.containsKey("getPlayed"))return 0;
		return map.get("getPlayed");
		
	}
	
	
	/**
	 * gets number of won matches
	 * @param won
	 */
	public int getWon(){
		if(!map.containsKey("getWon"))return 0;
		return map.get("getWon");
	}
	/**
	 * gets number of draws
	 * @param draws
	 */
	public int getDraws(){
		if(!map.containsKey("getDraws"))return 0;
		return map.get("getDraws");
	}
	
	/**
	 * gets number of lost matches
	 * @param lost
	 */
	public int getLost(){
		if(!map.containsKey("getLost"))return 0;
		return map.get("getLost");
	}
	
	/**
	 * number of the scored goals by this team
	 * @param scored
	 */
	public int getScored(){
		if(!map.containsKey("getScored"))return 0;
		return map.get("getScored");
	}
	
	/**
	 * number of received goals by this teams
	 * @param rec
	 */
	public int getReceived(){
		if(!map.containsKey("getReceived"))return 0;
		return map.get("getReceived");
	}
	
	/**
	 * point of the team at current point
	 * @param point
	 */
	public int getPoint(){
		if(!map.containsKey("getPoint"))return 1000;
		return map.get("getPoint");
	}
	
	/**
	 * place of the team in the championship
	 * @param place
	 */
	public int getPlace(){
		if(!map.containsKey("getPlace"))return 0;
		return map.get("getPlace");
	}
	
	public int getTeamID(){
		return team_id;
	}
	
	public int getChampionhipID(){
		return champ_id;
	}
	
}